/**
 * Created with WebStorm.
 * @Author: panda
 * @Date: 2022-05-18 09:25
 * @Description: 搜索模块数据请求
 */
import { createRequestClient } from './axios/request';
import { APISchema } from "@/api/axios/type";

interface SearchSchema extends APISchema {
  searchVideos: {
    request: {
      keyword: string, page: number
    };
    response: {};
  };
  searchArticle: {
    request: {
      keyword: string, page: number
    };
    response: {};
  };


}

export const searchApi = createRequestClient<SearchSchema>({
  baseURL: '',
  apis: {
    searchVideos: 'GET /search/videos',
    searchArticle: 'GET /articles/search'
  }
});
// 通过keyword搜索视频的数据请求
// export function searchVideos (keyword: string, page: number) {
//   return $http({
//     url: '/search/videos?keyword=' + keyword + '&page=' + page,
//     method: 'get',
//     headers: {
//       isToken: false
//     }
//   })
// }
//
// // 通过keyword搜索专栏文章的数据请求
// export function searchArticle (keyword: string, page: number) {
//   return $http({
//     url: '/search/article?keyword=' + keyword + '&page=' + page,
//     method: 'get',
//     headers: {
//       isToken: false
//     }
//   })
// }
